package br.com.marsso.sorte.server.service;

import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;

public class EntityService {
	private EntityManagerFactory emf;
	private EntityManager em;

	public EntityService() {
		try {
			emf = Persistence.createEntityManagerFactory("SortePU");

		} catch (Exception e) {

		}
	}

	public EntityManager getEntity() {
		if (em == null) {
			em = emf.createEntityManager();
		}

		return em;

	}
	
	

}
